package com.wsx.ones.monitor.core.common;

/**
 * 服务端的状态
 * Created by wangshuaixin on 17/2/10.
 */
public enum ChannelState {

    //未初始化
    UNINIT(1),
    //初始化
    INIT(2),
    //正常链接
    ALIVE(3),
    //不正常
    UNALIVE(4),
    //关闭
    CLOSED(5);

    public final int status;

    ChannelState(int status) {
        this.status = status;
    }

    public boolean isInit() {
        return this == INIT;
    }
    public boolean isUnInit() {
        return this == UNINIT;
    }

    public boolean isAlive() {
        return this == ALIVE;
    }
    public boolean isUnAlive() {
        return this == UNALIVE;
    }

    public boolean isClosed() {
        return this == CLOSED;
    }
}
